﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenRasta.Web;
using umbraco;
using umbraco.BusinessLogic;

namespace uREST.Core.Handlers
{
    public abstract class AbstractHandler
    {
        public ICommunicationContext Context { get; set; }
        public User AuthenticatedUser { get; set; }

        protected AbstractHandler(ICommunicationContext context)
        {
            Context = context;

            if(context.User.Identity.IsAuthenticated)
            {
                try
                {
                    AuthenticatedUser = new User(context.User.Identity.Name);
                }
                catch {}
            }
        }
    }
}
